package com.woniuxy.yoga.order.client;

import com.woniuxy.yoga.commons.core.model.Result;
import com.woniuxy.yoga.feign.config.FeignConfig;
import com.woniuxy.yoga.order.model.dto.Expcard;
import com.woniuxy.yoga.order.model.dto.Lifecard;
import com.woniuxy.yoga.order.model.form.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;


@FeignClient(name = "progress-service",configuration = FeignConfig.class,path = "/progress")
public interface ProgressClient {

    /**
     * 通过订单号查询体验卡进度
     * @param orderNum 订单编号
     * @return Expcard
     */
    @GetMapping("/expcard/getByOrderNum/{orderNum}")
    Result<Expcard> getExpCardByOrderNum(@PathVariable("orderNum")String orderNum);

    /**
     * 通过用户id查询体验卡进度
     * @param userId 订单编号
     * @return Expcard
     */
    @GetMapping("/expcard/getByUserId/{userId}")
    Result<Expcard> getExpCardByUserId(@PathVariable("userId")Integer userId);

    /**
     * 通过用户id查询终身卡进度
     * @param userId 用户id
     * @return Lifecard
     */
    @GetMapping("/lifecard/getByUserId/{userId}")
    Result<Lifecard> getLifeCardByUserId(@PathVariable("userId") Integer userId);

    /**
     * 创建次卡进度表
     * @param form 创建次卡进度表参数
     * @return String
     */
    @PostMapping("/subcard/createSubCard")
    Result<?> createSubCard(@RequestBody CreateSubCardForm form);

    /**
     * 创建体验课进度表
     * @param form 创建体验课进度表参数
     * @return String
     */
    @PostMapping("/expcard/createExpCard")
    Result<?> createExpCard(@RequestBody CreateExpCardForm form);

    /**
     * 创建月卡进度表
     * @param form 创建月卡进度表参数
     * @return String
     */
    @PostMapping("/moncard/createMonCard")
    Result<?> createMonCard(@RequestBody CreateMonCardForm form);

    /**
     * 创建终身卡进度表
     * @param form 创建终身卡进度表参数
     * @return String
     */
    @PostMapping("/lifecard/creatLifeCard")
    Result<?> createLifeCard(@RequestBody CreateLifeCardForm form);

    /**
     * 创建团课进度表
     * @param form 创建团课进度表参数
     * @return String
     */
    @PostMapping("/teacard/createTeaCard")
    Result<?> createTeaCard(@RequestBody CreateTeaCardForm form);

    /**
     * 创建私教课进度表
     * @param form 创建私教课进度表参数
     * @return String
     */
    @PostMapping("/pricard/createPriCard")
    Result<?> createPriCard(@RequestBody CreatePriCardForm form);
}
